package com.study.SellTicket;

import lombok.Data;

@Data
public class SellWindow implements Runnable{
    private String name;
    private Ticket ticket;

    public SellWindow(String name,Ticket ticket){
        this.name = name;
        this.ticket = ticket;
    }
    @Override
    public void run() {
        while (ticket.getTicketNum()>0){
            try {
                Thread.sleep(200);
                ticket.sell(this.name);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
